<ion-view view-title="天风宝">
    <ion-nav-buttons side="left">
        <back-button></back-button>
    </ion-nav-buttons>
    <div class="bar tab clearfix has-header" ng-class="{'has-loading': isOffline}">
        <ul>
            <input type="hidden" ng-model="channels[0].channelId" value="4683" keep-current-value/>
            <input type="hidden" ng-model="channels[0].adId" value="4610" keep-current-value/>
            <li ng-class="{current: vm.activeTab == 1}" style="width:50%">
                <em ng-click="vm.activeTab=1;">收益凭证</em></li>

            <input type="hidden" ng-model="channels[1].channelId" value="4685" keep-current-value/>
            <input type="hidden" ng-model="channels[1].adId" value="4612" keep-current-value/>
            <li ng-class="{current: vm.activeTab == 2}" style="width:50%">
                <em ng-click="vm.activeTab=2;showAdQszg()">券商资管</em></li>
        </ul>
    </div>
    <ion-content class="has-subheader" ng-class="{'has-loading': isOffline}">

        <ion-refresher pulling-text={{PULLING_TEXT}} pulling-icon="" refreshing-text={{REFRESHING_TEXT}}
                       on-refresh="doRefresh()"></ion-refresher>

        <div class="promo" ng-show="vm.activeTab == 1">
            <img ng-src="{{channels[0].imgSrc}}" alt="{{channels[0].imgAlt}}" ng-click="showAds(true)"/>
        </div>

        <div class="term tianfeng" ng-show="vm.activeTab == 1">
            <div class="panel" ng-repeat="fund in otcFunds">
                <a ng-href="#/tab/{{fund.prodType == 5 ? 'product-item-otc-float' : 'product-item-otc'}}/{{fund.contentId}}">
                    <h2 class="item">{{fund.prodName | defString}}<sup>{{fund.prodDuration | defNumber:null:'天，保本'}}</sup></h2>
                    <ins ng-if="fund.otcStatus==0">距抢购日还剩{{fund.bengin_date_show | defString}}天</ins>
                    <div class="item">
                        <p ng-if="fund.prodType == 5"><em class="inc">{{fund.expYearYieldMin|defNumber:0}}<sub>% ~</sub>{{fund.expYearYieldMax|defNumber:0}}<sub>%</sub></em>预期年化收益率</p>
                        <p ng-if="fund.prodType != 5"><em ng-class="{inc_ : fund.expYearYield < 0}">{{fund.expYearYield | defNumber :4}}<sub>%</sub></em>预期收益率</p>
                        <p><em ng-bind-html="fund.prodMinSubscribe"></em>起购金额</p>
                        <span ng-if="fund.sellStatus == 2" class="btn disable">购买</span>
                        <span ng-if="fund.sellStatus == 3" class="btn disable">已售罄</span>
                        <span ng-if="fund.sellStatus == 4" class="btn disable">暂停申购</span>
                        <span ng-if="fund.sellStatus == 5" class="btn disable">暂停交易</span>
                    </div>
                </a>
                <a ng-if="fund.sellStatus == 1" class="btn"
                      buy-button prod_code="{{fund.prodCode}}" prod_source="1" >购买</a>
            </div>
        </div>

        <div class="promo" ng-show="vm.activeTab == 2">
            <img ng-src="{{channels[1].imgSrc}}" alt="{{channels[1].imgAlt}}" ng-click="showAdQszg(true)"/>
        </div>
        <div class="term tianfeng" ng-show="vm.activeTab == 2">
            <div class="panel" ng-repeat="fund in zgFunds">
                <a href="#/tab/product-item/{{fund.contentId}}" >
                    <h2 class="item">{{fund.contentName | defString}}<sup>{{fund.prodDuration | defNumber:null:'天，保本'}}</sup></h2>
                    <div class="item">
                        <p ng-if="'9'==fund.prodType">
                            <em ng-class="{inc_ : fund.rrInSingleYear < 0}">{{fund.rrInSingleYear | defNumber :4}}<sub>%</sub></em>近一年涨幅
                        </p>
                        <p ng-if="'9'!=fund.prodType">
                            <em ng-class="{inc_ : fund.expYearYield < 0}">{{fund.expYearYield | defNumber :4}}<sub>%</sub></em>预期收益率
                        </p>
                        <p><em>{{fund.prodNav | defNumber:4}}<sub>元</sub></em>单位净值</p>
                        <p><em ng-bind-html="fund.prodMinSubscribe"></em>起购金额</p>
                    </div>
                </a>
            </div>
        </div>
    </ion-content>
</ion-view>